package com.dwx.shopping_mall.service.impl;

import com.dwx.shopping_mall.entity.User;
import com.dwx.shopping_mall.mapper.UserMapper;
import com.dwx.shopping_mall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public int addUser(User user) {
        Date date = new Date();
        user.setCreateDate(date);
        user.setUpdateDate(date);
        return userMapper.insert(user);
    }

}
